﻿//
// Copyright (c) 2010
// by Chris Paterra
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
// to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions 
// of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
// DEALINGS IN THE SOFTWARE.
//

using System;
using System.Collections.Generic;
using DotNetNuke.ContentLibrary.Components.Controllers;

namespace DotNetNuke.ContentLibrary.Components.Entities
{

	/// <summary>
	/// This is our Info class that represents columns in our data store that are associated with the DCL_Review table.
	/// </summary>
	public class ReviewInfo
	{

		#region Public Properties

		public int ReviewID { get; set; }

		public string Title { get; set; }

		public string ProComment { get; set; }

		public string ConComment { get; set; }

		public string Comment { get; set; }

		public bool Approved { get; set; }

		public bool Indexed { get; set; }

		public int ContentItemID { get; set; }

		public int ChildKeyID { get; set; }

		public int ChildTypeID { get; set; }

		public int ReviewMode { get; set; }

		public int CreatedByUserID { get; set; }

		public DateTime CreatedOnDate { get; set; }

		public int ApprovedByUserID { get; set; }

		public DateTime ApprovedOnDate { get; set; }

		public int LastModifiedByUserID { get; set; }

		public DateTime LastModifiedOnDate { get; set; }

		//Not stored as columns
		public int TotalRecords { get; set; }

		public string DisplayName { get; set; }

        /// <summary>
        /// 
        /// </summary>
        /// <remarks>Eventually, this needs to be a List of ReviewRatingInfo.</remarks>
		public ReviewRatingInfo ReviewRatings
		{
			get { 
				var controller = new ContentLibraryController();
				return controller.GetReviewRating(ReviewID);
			}
		}

        /// <summary>
        /// This is being used to handle a single overall review rating value.
        /// </summary>
        /// <remarks>Currently, only 1 rating is permitted per review but this may change in future.</remarks>
        public decimal OverallUserRating { get; set; }

		#endregion

	}
}